home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / misc / DReg.lha / DReg / regsub.s < prev   
Text File  |  1994-06-26  |  26KB  |  675 lines

  1.  
  2. *   Module:     regsub.s
  3. *
  4. *                xref    reg_cycle,one_only,set_bits
  5. *                xref    gad_refrsh,dat_disp,displ_val
  6. *                xref    activ_bits,hex_Cnv,conv_disp
  7. *                xref    stuffChar,disp_flag
  8. *                xref    processit,do_about
  9.  
  10.  
  11. *****************************************************************************
  12. *
  13. *       Cycle through operator and operand registers
  14. *       inputs:     a3  <-holds pointer to gadget structure
  15. *                   d6  <-number of registers accessible in list
  16.  
  17.  
  18. reg_cycle:  movea.l intuitionBase,a6        a6<-using intuition library
  19.             lea.l   regselect,a0            a0<-list of text pointers
  20.             moveq.w #0,d4
  21.             movea.l gg_GadgetText(a3),a2
  22.             movea.l it_IText(a2),a2
  23. .cycle:     cmpa.l  (a0,d4),a2                  last used selection
  24.             beq.s   .foundit
  25.             addq.w  #4,d4                   point to next selector
  26.             bra.s   .cycle
  27. .foundit:   addq.w  #4,d4
  28.             mulu.w  #4,d6
  29.             cmp.w   d4,d6                   check for end of list
  30.             bpl.s   .picksel
  31.             moveq.w #0,d4
  32. .picksel:   move.l  (a0,d4),d0              d0 - selected text
  33.             move.l  gg_GadgetText(a3),a2
  34.             move.l  d0,it_IText(a2)
  35.             move.l  regoff(a0,d4),d0        offset depends on no of regs
  36.  
  37.             cmpi.w  #80,d7                  which register selector ?
  38.             beq.s   .destreg
  39.             move.l  d0,sourcinput           store the active register
  40.             lea.l   srchexdn1,a1            a1<-points to LS digit
  41.             bra.s   .display
  42. .destreg:   move.l  d0,destinput
  43.             lea.l   dsthexdn1,a1
  44. .display:   move.l  d0,a2
  45.             move.l  (a2),d6                 get register contents...
  46.             moveq.l #1,d0                      refresh the one...
  47.             bsr     gad_refrsh
  48.  
  49.             cmpi.w  #80,d7                  which register selector ?
  50.             beq.s   .destbits
  51.             lea.l   SrcRGdg00,a3
  52.             bra.s   .activ
  53. .destbits:  lea.l   DstRGdg00,a3
  54. .activ:     moveq.l #32,d0                      ...refresh the gadgets
  55.             bsr     activ_bits              set up bit-display
  56.             bsr     gad_refrsh
  57.             bsr     conv_disp               convert bits into hex
  58.             bsr     displ_val               put up hex display
  59. .rc_ex:     move.l  _SysBase,a6             a6 <- SysBase for Mesg
  60.             rts
  61.  
  62.  
  63. *****************************************************************************
  64. *
  65. *       Change the mutual exclusive toggles ( .b .w .l )
  66. *       inputs:     a3 <- pointer to gadget structure
  67. *                   d7  <-should still hold GadgetID
  68.  
  69.  
  70. one_only:   movea.l intuitionBase,a6        a6<-using intuition library
  71.             move.w  #SELECTED,d5
  72.             lea.l   OpSizByte,a1
  73.             lea.l   OpSizWord,a2
  74.             move.w  d7,d0
  75.             subi.w  #91,d0
  76.             move.b  d0,op_size
  77.             bmi.s   .isbyte
  78.             bne.s   .sel_gad                    this is the .L = +1
  79. .isword:    lea.l   OpSizLong,a2                this is the .W = 0
  80.             bra.s   .sel_gad
  81. .isbyte:    lea.l   OpSizLong,a1                this is the .B = -1
  82. .sel_gad:   or.w    d5,gg_Flags(a3)             selected
  83.             not.w   d5
  84.             and.w   d5,gg_Flags(a1)             deselected
  85.             and.w   d5,gg_Flags(a2)             deselected
  86. .refrsh:    lea.l   OpSizByte,a3            start with first in list
  87.             moveq.l #3,d0                       and refresh all three...
  88.             bsr.s   gad_refrsh
  89.             bsr     processit               just to get things displayed
  90. .oo_ex:     move.l  _SysBase,a6             a6 <- SysBase for Mesg
  91.             rts
  92.  
  93.  
  94. *****************************************************************************
  95. *
  96. *       Select/deselect bits according to flags (condition codes)
  97. *       input:      a0 <- points to the text-string
  98. *                   d3 <- number of bits
  99. *                   d6 <- register value
  100.  
  101.  
  102. set_bits:   movem.l d4-d6,-(sp)
  103. .onebit:    move.w  d3,d4
  104.             asl.w   #1,d4                   d4<-index for textstrings
  105.             btst.l  d3,d6
  106.             beq.s   .zerobit
  107.             move.b  #'1',(a0,d4)            set individual bit and...
  108.             bra.s   .getnxt
  109. .zerobit:   move.b  #'0',(a0,d4)
  110. .getnxt:    dbra    d3,.onebit                    ...go 'till finished
  111. .sb_ex:     movem.l (sp)+,d4-d6
  112.             rts
  113.  
  114.  
  115. *****************************************************************************
  116. *
  117. *       Refresh a specified number of gadgets
  118. *       Inputs:     a3 <- pointer to gadget structure
  119. *                   a4 <- window pointer
  120. *                   d0 <- number of gads to refresh
  121.  
  122.  
  123. gad_refrsh: movem.l a0-a2/d4,-(sp)
  124.             moveq.l #0,d4
  125.             movea.l a3,a0                   pointer to gadget struct
  126.             movea.l a4,a1                   the window's pointer
  127.             move.l  d4,a2                   no requester yet...
  128.             jsr     _LVORefreshGList(a6)
  129. .gr_ex:     movem.l (sp)+,a0-a2/d4
  130.             rts
  131.  
  132.  
  133. *****************************************************************************
  134. *
  135. *       Process the bitwise input and display hex
  136. *       inputs:     a3 <- pointer to gadget structure
  137. *                   d7 <- holds gadget ID
  138.  
  139.  
  140. dat_disp:   movea.l intuitionBase,a6        a6<-using intuition library
  141.             move.l  d7,d4                   d4<-gadget ID
  142.             cmpi.w  #40,d7
  143.             bgt.s   .destreg
  144.             movea.l sourcinput,a2           a2<-holds register address
  145.             lea.l   srchexdn1,a1            a1<-points to LS hex digit
  146.             bra.s   .addbit
  147. .destreg:   movea.l destinput,a2
  148.             lea.l   dsthexdn1,a1
  149.             subi.w  #40,d4
  150. .addbit:    moveq.l #0,d5
  151.             subi.w  #1,d4
  152.             bset.l  d4,d5                   d5<-bit changed by user
  153.             lsl.w   #1,d4                   d4<-index for textstrings
  154.             move.l  (a2),d6                 get the register contents
  155.             eor.l   d5,d6                       change the bit
  156.             move.l  d6,(a2)                         then replace
  157.             moveq.l #1,d0                       and refresh one gadget
  158.             bsr.s   gad_refrsh
  159.             bsr     conv_disp               convert bits into hex
  160.  
  161.             cmpa.l  sourcinput,a2
  162.             bne.s   .noteq                  check if both displays equal
  163.             cmpa.l  destinput,a2
  164.             bne.s   .noteq
  165.  
  166.             cmpi.w  #39,d7                  we have changed one set...
  167.             bgt.s   .isdest
  168.             lea.l   dsthexdn1,a1
  169.             lea.l   DstRGdg00,a3                ...now we do the other
  170.             bra.s   .dobits
  171. .isdest:    lea.l   srchexdn1,a1            a1<-points to LS hex digit
  172.             lea.l   SrcRGdg00,a3
  173. .dobits:    moveq.l #32,d0                  refresh these gadgets
  174.             bsr.s   activ_bits              put up bit-gadgets (a3,d0,d6)
  175.             bsr     gad_refrsh
  176.             bsr     conv_disp               convert bits into hex
  177. .noteq:     bsr.s   displ_val               put up hex display
  178.  
  179. .dd_ex:     move.l  _SysBase,a6             a6 <- SysBase for Mesg
  180.             rts
  181.  
  182.  
  183. *****************************************************************************
  184. *
  185. *       Display the hex values and their borders
  186. *       inputs:     a4 <- window pointer
  187.  
  188.  
  189. displ_val:  movem.l a0-a2/d4-d5,-(sp)
  190.             tst.w   dispsel
  191.             bne.s   .dec_val
  192.             lea.l   BordrHexa,a1            use the hex nibbles border
  193.             lea.l   ITxSNib0,a2
  194.             bra.s   .val_ex
  195. .dec_val:   lea.l   BordDBack,a1            use the hex background border
  196.             lea.l   ITxtSDec,a2
  197. .val_ex:    exg.l   a1,d4
  198.             exg.l   a2,d5
  199.             movea.l wd_RPort(a4),a0         get the window's rastport
  200.             move.l  d4,a1                       and the borders
  201.             move.l  #359,d0                 relative X pos in window
  202.             moveq.l #14,d1                     "     Y pos
  203.             jsr     _LVODrawBorder(a6)
  204.             movea.l wd_RPort(a4),a0
  205.             move.l  d4,a1                   and again for destination
  206.             move.l  #359,d0
  207.             moveq.l #26,d1
  208.             jsr     _LVODrawBorder(a6)
  209.             movea.l wd_RPort(a4),a0         this will do all hex text...
  210.             move.l  d5,a1
  211.             move.l  #359,d0                 source/dest decimal strings
  212.             moveq.l #14,d1                           are connected
  213.             jsr     _LVOPrintIText(a6)
  214. .dv_ex:     movem.l (sp)+,a0-a2/d4-d5
  215.             rts
  216.  
  217.  
  218. *****************************************************************************
  219. *
  220. *       Activate bit-gadgets according to input register
  221. *       inputs:     a3 <- pointer to gadget structure
  222. *                   d0 <- number of bits +1
  223. *                   d6 <- register value
  224.  
  225.  
  226. activ_bits: movem.l a3/d1-d4,-(sp)
  227.             move.w  d0,d3
  228.             subq.w  #1,d3                   d3<-counter
  229.             move.w  #SELECTED,d1
  230.             move.w  d1,d2
  231.             not.w   d2                      d2<-!SELECTED
  232. .loop:      moveq.w #31,d4
  233.             sub.w   d3,d4                   reverse counter
  234.             btst.l  d4,d6
  235.             beq.s   .desel
  236.             or.w    d1,gg_Flags(a3)         Flags & SELECTED
  237.             bra.s   .tonext
  238. .desel:     and.w   d2,gg_Flags(a3)         Flags deselected
  239. .tonext:    suba.w  #44,a3
  240.             dbra    d3,.loop
  241. .ab_ex:     movem.l (sp)+,a3/d1-d4
  242.             rts
  243.  
  244.  
  245. *****************************************************************************
  246. *
  247. *       Convert register values to hex and decimal to display them
  248. *       inputs:     a1 <- points to the hex text-string
  249. *                   a2 <- points to the input reg value
  250. *                   d6 <- register value
  251.  
  252.  
  253. hex_Cnv:    move.b  (a0,d4),d1
  254.             lsl.w   d2,d1
  255.             move.w  d1,(a1)+
  256.             rts
  257.  
  258. conv_disp:  movem.l a0-a3/d4-d6,-(sp)
  259.             lea.l   hex_array,a0
  260.             moveq.l #8,d2                   d2<-constant 8 for shift
  261.             moveq.w #3,d3                   d3<-this many bytes -1
  262.             moveq.l #0,d4                   wipe it first
  263. .getnib:    move.b  d6,d4
  264.             andi.b  #$0f,d4
  265.             bsr.s   hex_Cnv                 convert a nibble to hex
  266.             move.b  d6,d4
  267.             lsr.b   #4,d4                       and again...
  268.             bsr.s   hex_Cnv
  269.             lsr.l   d2,d6                   go to next byte up
  270.             dbra    d3,.getnib
  271.  
  272.  
  273. *       here a1 points to the decimal display string and a2 to input reg
  274.  
  275.             exg.l   a1,a3                   a3<-output string pointer
  276.             move.l  (a2),d5
  277.             lea.l   rawstuff,a1             a1<-pointer to input value
  278.             lea.l   FormLSign,a0
  279.             tst.b   op_size                 check display size
  280.             bmi.s   .dibyt
  281.             beq.s   .diwrd
  282.             bra.s   .dilng
  283. .dibyt:     ext.w   d5                      sign extend byte to word
  284. .diwrd:     swap    d5                      a1 points to int now
  285.             lea.l   FormISign,a0
  286. .dilng:     move.l  d5,(a1)
  287.             lea.l   stuffChar,a2            the routine to...
  288.             move.l  _SysBase,a6
  289.             jsr     _LVORawDoFmt(a6)
  290.             adda.w  #15,a3                  point to end of fmt string
  291.             movea.l a3,a1
  292.             movea.l a3,a2
  293.             adda.w  #16,a1                      and end of disp string
  294.             moveq.b #',',d2                 thousands divider
  295.             moveq.b #' ',d5                 space
  296.             moveq.b #'-',d1                 minus sign
  297.             moveq.w #3,d4                   four commas's...
  298. .conlp:     moveq.w #2,d3                       ...one every three chars
  299. .conki:     move.b  -(a3),d0
  300.             move.b  d0,-(a1)
  301.             move.b  -1(a3),d0
  302.             dbra    d3,.conki
  303.             cmp.b   d5,d0                   is it a space ?
  304.             beq.s   .nodot
  305.             cmp.b   d1,d0                   is it a minus sign ?
  306.             bne.s   .doone
  307.             move.b  d0,-(a1)
  308.             bra.s   .nodot
  309. .doone:     move.b  d2,-(a1)
  310.             dbra    d4,.conlp
  311. .nodot:     cmpa.l  a1,a2
  312.             bpl.s   .doint
  313.             move.b  d5,-(a1)                yes - we fill it with spaces
  314.             bra.s   .nodot
  315. .doint:     movea.l intuitionBase,a6
  316. .cd_ex:     movem.l (sp)+,a0-a3/d4-d6
  317.             rts
  318.  
  319. stuffChar:  move.b  d0,(a3)+                ...put data to output string
  320.             rts
  321.  
  322.  
  323. *****************************************************************************
  324. *
  325. *       Display the flags' values and borders
  326. *       inputs:     a4 <- window pointer
  327.  
  328.  
  329. disp_flag:  movea.l wd_RPort(a4),a0
  330.             lea.l   BordrFlga,a1            use the flags borders
  331.             move.l  #392,d0
  332.             moveq.l #38,d1
  333.             jsr     _LVODrawBorder(a6)
  334.             movea.l wd_RPort(a4),a0         this will do all flag text...
  335.             lea.l   ITxtFlgx,a1
  336.             move.l  #359,d0
  337.             moveq.l #14,d1
  338.             jsr     _LVOPrintIText(a6)
  339. .flag_ex:   rts
  340.  
  341.  
  342. *****************************************************************************
  343. *
  344. *       Process the input with the selected action
  345. *       input:      d7 <- holds GadgetID
  346.  
  347.  
  348. processit:  movem.l a6,-(sp)
  349.             movea.l sourcinput,a1           pick up source and
  350.             movea.l destinput,a2                    dest reg address
  351.             move.l  (a1),d5                         and their values
  352.             move.l  d5,oldsrcreg            d5<-source register
  353.             move.l  (a2),d6                 d6<-destination reg
  354.             moveq.l #0,d2                   d2<-a constant zero
  355.             move.l  d2,d3
  356.             cmpi.w  #200,d7                 check which op-code
  357.             beq     .opclr
  358.             cmpi.w  #201,d7                 neg
  359.             beq     .opneg
  360.             cmpi.w  #202,d7                 not
  361.             beq     .opnot
  362.             cmpi.w  #203,d7                 and
  363.             beq     .opand
  364.             cmpi.w  #204,d7                 or
  365.             beq     .opor
  366.             cmpi.w  #205,d7                 eor
  367.             beq     .opeor
  368.             cmpi.w  #206,d7                 lsl
  369.             beq     .oplsl
  370.             cmpi.w  #207,d7                 rol
  371.             beq     .oprol
  372.             cmpi.w  #208,d7                 roxl
  373.             beq     .oproxl
  374.             cmpi.w  #209,d7                 lsr
  375.             beq     .oplsr
  376.             cmpi.w  #210,d7                 ror
  377.             beq     .opror
  378.             cmpi.w  #211,d7                 roxr
  379.             beq     .oproxr
  380.             cmpi.w  #212,d7                 asl
  381.             beq     .opasl
  382.             cmpi.w  #213,d7                 mulu
  383.             beq     .opmulu
  384.             cmpi.w  #214,d7                 muls
  385.             beq     .opmuls
  386.             cmpi.w  #215,d7                 asr
  387.             beq     .opasr
  388.             cmpi.w  #216,d7                 divu
  389.             beq     .opdivu
  390.             cmpi.w  #217,d7                 divs
  391.             beq     .opdivs
  392.             cmpi.w  #218,d7                 add
  393.             beq     .opadd
  394.             cmpi.w  #219,d7                 exg
  395.             beq     .opexg
  396.             cmpi.w  #220,d7                 move
  397.             beq     .opmove
  398.             cmpi.w  #221,d7                 sub
  399.             beq     .opsub
  400.             cmpi.w  #222,d7                 swap
  401.             bne     .do_sorc                then either quit...
  402.             swap    d6                      ...or deal with a swap
  403.             bra     .get_flg
  404. .opclr:     tst.b   op_size
  405.             bmi.s   .clbyt
  406.             beq.s   .clwrd
  407.             clr.l   d6                      clear long,
  408.             bra     .get_flg
  409. .clwrd:     clr.w   d6                              word,
  410.             bra     .get_flg
  411. .clbyt:     clr.b   d6                                  or byte
  412.             bra     .get_flg
  413. .opneg:     tst.b   op_size
  414.             bmi.s   .ngbyt
  415.             beq.s   .ngwrd
  416.             neg.l   d6                      arithmetic neg long,
  417.             bra     .get_flg
  418. .ngwrd:     neg.w   d6                              word,
  419.             bra     .get_flg
  420. .ngbyt:     neg.b   d6                                  or byte
  421.             bra     .get_flg
  422. .opnot:     tst.b   op_size
  423.             bmi.s   .ntbyt
  424.             beq.s   .ntwrd
  425.             not.l   d6                      arithmetic not long,
  426.             bra     .get_flg
  427. .ntwrd:     not.w   d6                              word,
  428.             bra     .get_flg
  429. .ntbyt:     not.b   d6                                  or byte
  430.             bra     .get_flg
  431. .opand:     tst.b   op_size
  432.             bmi.s   .anbyt
  433.             beq.s   .anwrd
  434.             and.l   d5,d6                   logical and long,
  435.             bra     .get_flg
  436. .anwrd:     and.w   d5,d6                           word,
  437.             bra     .get_flg
  438. .anbyt:     and.b   d5,d6                               or byte
  439.             bra     .get_flg
  440. .opor:      tst.b   op_size
  441.             bmi.s   .orbyt
  442.             beq.s   .orwrd
  443.             or.l    d5,d6                   logical or long,
  444.             bra     .get_flg
  445. .orwrd:     or.w    d5,d6                           word,
  446.             bra     .get_flg
  447. .orbyt:     or.b    d5,d6                               or byte
  448.             bra     .get_flg
  449. .opeor:     tst.b   op_size
  450.             bmi.s   .eobyt
  451.             beq.s   .eowrd
  452.             eor.l   d5,d6                   exclusive or long,
  453.             bra     .get_flg
  454. .eowrd:     eor.w   d5,d6                           word,
  455.             bra     .get_flg
  456. .eobyt:     eor.b   d5,d6                               or byte
  457.             bra     .get_flg
  458. .oplsl:     tst.b   op_size
  459.             bmi.s   .llbyt
  460.             beq.s   .llwrd
  461.             lsl.l   d5,d6                   logical shift left long,
  462.             bra     .get_flg
  463. .llwrd:     lsl.w   d5,d6                           word,
  464.             bra     .get_flg
  465. .llbyt:     lsl.b   d5,d6                               or byte
  466.             bra     .get_flg
  467. .oprol:     tst.b   op_size
  468.             bmi.s   .rlbyt
  469.             beq.s   .rlwrd
  470.             rol.l   d5,d6                   rotate left long,
  471.             bra     .get_flg
  472. .rlwrd:     rol.w   d5,d6                           word,
  473.             bra     .get_flg
  474. .rlbyt:     rol.b   d5,d6                               or byte
  475.             bra     .get_flg
  476. .oproxl:    moveq.l #0,d0                   condcodes -> CCR
  477.             move.w  condcodes,d0
  478.             moveq.b #%00010000,d1           affect only X flag
  479.             jsr     _LVOSetSR(a6)           a6<-is still _SysBase
  480.             tst.b   op_size
  481.             bmi.s   .xlbyt
  482.             beq.s   .xlwrd
  483.             roxl.l  d5,d6                   rotate extended left long,
  484.             bra     .get_flg
  485. .xlwrd:     roxl.w  d5,d6                           word,
  486.             bra     .get_flg
  487. .xlbyt:     roxl.b  d5,d6                               or byte
  488.             bra     .get_flg
  489. .oplsr:     tst.b   op_size
  490.             bmi.s   .lrbyt
  491.             beq.s   .lrwrd
  492.             lsr.l   d5,d6                   logical shift right long,
  493.             bra     .get_flg
  494. .lrwrd:     lsr.w   d5,d6                           word,
  495.             bra     .get_flg
  496. .lrbyt:     lsr.b   d5,d6                               or byte
  497.             bra     .get_flg
  498. .opror:     tst.b   op_size
  499.             bmi.s   .rrbyt
  500.             beq.s   .rrwrd
  501.             ror.l   d5,d6                   rotate right long,
  502.             bra     .get_flg
  503. .rrwrd:     ror.w   d5,d6                           word,
  504.             bra     .get_flg
  505. .rrbyt:     ror.b   d5,d6                               or byte
  506.             bra     .get_flg
  507. .oproxr:    moveq.l #0,d0                   condcodes -> CCR
  508.             move.w  condcodes,d0
  509.             moveq.b #%00010000,d1           affect only X flag
  510.             jsr     _LVOSetSR(a6)           a6<-is still _SysBase
  511.             tst.b   op_size
  512.             bmi.s   .xrbyt
  513.             beq.s   .xrwrd
  514.             roxr.l  d5,d6                   rotate extended right long,
  515.             bra     .get_flg
  516. .xrwrd:     roxr.w  d5,d6                           word,
  517.             bra     .get_flg
  518. .xrbyt:     roxr.b  d5,d6                               or byte
  519.             bra     .get_flg
  520. .opasl:     tst.b   op_size
  521.             bmi.s   .albyt
  522.             beq.s   .alwrd
  523.             asl.l   d5,d6                   arithmetic shift left long,
  524.             bra     .get_flg
  525. .alwrd:     asl.w   d5,d6                           word,
  526.             bra.s   .get_flg
  527. .albyt:     asl.b   d5,d6                               or byte
  528.             bra.s   .get_flg
  529. .opmulu:    mulu.w  d5,d6                   multiply unsigned
  530.             bra.s   .get_flg
  531. .opmuls:    muls.w  d5,d6                   multiply signed
  532.             bra.s   .get_flg
  533. .opasr:     tst.b   op_size
  534.             bmi.s   .arbyt
  535.             beq.s   .arwrd
  536.             asr.l   d5,d6                   arithmetic shift right long,
  537.             bra.s   .get_flg
  538. .arwrd:     asr.w   d5,d6                           word,
  539.             bra.s   .get_flg
  540. .arbyt:     asr.b   d5,d6                               or byte
  541.             bra.s   .get_flg
  542. .opdivu:    tst.w   d5
  543.             beq.s   .prc_pass
  544.             divu.w  d5,d6                   divide unsigned
  545.             bra.s   .get_flg
  546. .opdivs:    tst.w   d5
  547.             beq.s   .prc_pass
  548.             divs.w  d5,d6                   divide signed
  549.             bra.s   .get_flg
  550. .opadd:     tst.b   op_size
  551.             bmi.s   .adbyt
  552.             beq.s   .adwrd
  553.             add.l   d5,d6                   add long,
  554.             bra.s   .get_flg
  555. .adwrd:     add.w   d5,d6                           word,
  556.             bra.s   .get_flg
  557. .adbyt:     add.b   d5,d6                               or byte
  558.             bra.s   .get_flg
  559. .opexg:     exg.l   d5,d6                   exchange long
  560.             move.l  d5,(a1)
  561.             move.l  d6,(a2)
  562.             movea.l a1,a2
  563.             bra.s   .do_sorc
  564. .opmove:    tst.b   op_size
  565.             bmi.s   .mobyt
  566.             beq.s   .mowrd
  567.             move.l  d5,d6                   move long,
  568.             bra.s   .get_flg
  569. .mowrd:     move.w  d5,d6                           word,
  570.             bra.s   .get_flg
  571. .mobyt:     move.b  d5,d6                               or byte
  572.             bra.s   .get_flg
  573. .opsub:     tst.b   op_size
  574.             bmi.s   .subyt
  575.             beq.s   .suwrd
  576.             sub.l   d5,d6                   subtract long,
  577.             bra.s   .get_flg
  578. .suwrd:     sub.w   d5,d6                           word,
  579.             bra.s   .get_flg
  580. .subyt:     sub.b   d5,d6                               or byte
  581.  
  582.  
  583. *       Operation done - pick up flags and display result
  584.  
  585. .get_flg:   exg.l   d0,d2
  586.             exg.l   d1,d3
  587.             jsr     _LVOSetSR(a6)           SR -> condcodes
  588.             move.w  d0,condcodes            store flags register
  589.             move.l  d6,(a2)                 replace destination
  590.             cmpa.l  a1,a2
  591.             bne.s   .prc_pass               if src/dest different
  592.             move.l  (a1),d5
  593.             move.l  oldsrcreg,d3
  594.             cmp.l   d3,d5                   has source changed ?
  595.             beq.s   .prc_pass
  596. .do_sorc:   move.l  d5,d6
  597.             bsr.s   disp_src                    then display it
  598.  
  599. .prc_pass:  movea.l intuitionBase,a6        a6<-using intuition library
  600.             lea.l   DstRGdg00,a3
  601.             moveq.l #32,d0
  602.             bsr     activ_bits              set up bit-display
  603.             bsr     gad_refrsh              refr:  a3<-gad, a4, d0
  604.             lea.l   dsthexdn1,a1
  605.             movea.l destinput,a2
  606.             move.l  (a2),d6
  607.             bsr     conv_disp               conv_disp: a1<-hxtxt, d6<-reg
  608.             moveq.l #0,d6
  609.             move.w  condcodes,d6
  610.             lea.l   flagsdispx,a0
  611.             moveq.l #4,d3                   five flags - x n z v c
  612.             bsr     set_bits                set_bits: a0<-txt, d3, d6
  613.             bsr     displ_val               put up hex and
  614.             bsr     disp_flag                              flags display
  615. .prc_ex:    movem.l (sp)+,a6                a6 <- SysBase for Mesg
  616.             rts
  617.  
  618.  
  619. disp_src:   movea.l intuitionBase,a6        a6<-using intuition library
  620.             lea.l   SrcRGdg00,a3
  621.             moveq.l #32,d0
  622.             bsr     activ_bits              set up bit-display
  623.             bsr     gad_refrsh              refr:  a3<-gad, a4, d0
  624.             lea.l   srchexdn1,a1
  625.             movea.l sourcinput,a2
  626.             move.l  (a2),d6
  627.             bsr     conv_disp               conv_disp: a1<-hxtxt, d6<-reg
  628.             movea.l destinput,a2
  629.             move.l  (a2),d6                     and restore dest
  630. di_ex:      rts
  631.  
  632.  
  633. *****************************************************************************
  634. *
  635. *       Display the 'ABOUT' message
  636.  
  637.  
  638. do_about:   move.l  #reqsize,d0             private memory for
  639.             moveq.l #1,d1                           requester structure
  640.             moveq.w #16,d2
  641.             lsl.l   d2,d1
  642.             jsr     _LVOAllocMem(a6)
  643.             move.l  d0,regRequest
  644.             beq.s   .abou_ex
  645.             move.l  d0,a0
  646.             move.w  #3,rq_LeftEdge(a0)
  647.             move.w  #12,rq_TopEdge(a0)
  648.             move.w  #442,rq_Width(a0)
  649.             move.w  #61,rq_Height(a0)
  650.             move.l  #AbOkay,rq_ReqGadget(a0)
  651.             move.l  #ITxFCpyRt,rq_ReqText(a0)
  652.             move.w  wflood,d0
  653.             move.b  d0,rq_BackFill(a0)
  654.             movea.l intuitionBase,a6        a6<-using intuition library
  655.             movea.l a4,a1
  656.             jsr     _LVORequest(a6)
  657.             move.l  _SysBase,a6             a6<-changed to SysBase
  658.             tst.w   d0
  659.             beq.s   .free_rs
  660. .wait_msg:  move.l  wd_UserPort(a4),a0      find window's user port address
  661.             move.b  MP_SIGBIT(a0),d7        d7<-number of message signal
  662.             moveq.l #1,d0
  663.             lsl.l   d7,d0                   d0<-calculate signal value
  664.             jsr     _LVOWait(a6)            and wait until signal occurs
  665. .free_rs:   movea.l regRequest,a1
  666.             move.l  #reqsize,d0
  667.             jsr     _LVOFreeMem(a6)
  668. .abou_ex:   rts
  669.  
  670.  
  671. *****************************************************************************
  672.  
  673.  
  674.  
  675.